Imports System.Data
Imports System.Data.SqlClient

Public Interface ISql

    Enum Formato
        Fecha = 0
        Hora = 1
        FechaHora = 2
    End Enum

    Property SPConfigXML() As String
    Property SPConfigXMLFile() As String

    Function [Select](ByVal connectionString As String, ByRef ds As DataSet, _
        Optional ByVal nombreCampos As String = "*", Optional ByVal sOrigen As String = Nothing, _
        Optional ByVal condicion As String = Nothing, Optional ByVal sOrden As String = Nothing, _
        Optional ByVal sGrupo As String = Nothing, Optional ByVal sHaving As String = Nothing) As DataSet

    Function [Select](ByVal connectionString As String, Optional ByVal nombreCampos As String = "*", _
            Optional ByVal sOrigen As String = Nothing, Optional ByVal condicion As String = Nothing, _
            Optional ByVal sOrden As String = Nothing, Optional ByVal sGrupo As String = Nothing, _
            Optional ByVal sHaving As String = Nothing) As DataSet

    Function Insert(ByVal connectionString As String, _
                    ByVal tabla As String, _
                    ByVal nombreCampos As String, _
                    ByVal valores As String, _
                    Optional ByVal insertMasivo As Boolean = False) As Integer

    Function Update(ByVal connectionString As String, _
                    ByVal tabla As String, _
                    ByVal nombreCampos As String, _
                    ByVal valores As String, _
                    Optional ByVal desde As String = Nothing, _
                    Optional ByVal condicion As String = Nothing, _
                    Optional ByVal updateMasivo As Boolean = False) As Integer

    Function Delete(ByVal connectionString As String, _
                    ByVal tabla As String, _
                    Optional ByVal condicion As String = "") As Integer

    Overloads Function Exec(ByVal transaction As SqlTransaction, _
                            ByVal commandText As String) As Integer

    Overloads Function Exec(ByVal connectionString As String, _
                            ByVal commandText As String) As Integer

    Overloads Function Exec(ByVal cn As SqlConnection, _
                            ByVal commandText As String) As Integer

    Overloads Function ExecSP(ByVal connectionString As String, _
                                ByVal nombreStoredProcedure As String, _
                                Optional ByVal arrayParam As ArrayList = Nothing) As Boolean

    Overloads Function ExecSP(ByVal cn As SqlConnection, _
                                ByVal nombreStoredProcedure As String, _
                                Optional ByVal arrayParam As ArrayList = Nothing) As Boolean

    Overloads Function ExecSP(ByVal cn As SqlConnection, _
                                ByVal transaction As SqlTransaction, _
                                ByVal nombreStoredProcedure As String, _
                                Optional ByVal arrayParam As ArrayList = Nothing) As Boolean

    Overloads Function ExecSPOV(ByVal connectionString As String, _
                                ByVal nombreStoredProcedure As String, _
                                Optional ByVal ParamValues As ArrayList = Nothing) As ArrayList

    Overloads Function ExecSPOV(ByVal cn As SqlConnection, _
                                ByVal nombreStoredProcedure As String, _
                                Optional ByVal ParamValues As ArrayList = Nothing) As ArrayList

    Overloads Function Search(ByVal connectionString As String, _
                                ByVal sCampo As String, _
                                ByVal sOrigen As String) As Object

    Overloads Function Search(ByVal connectionString As String, _
                                ByVal sCampo As String, _
                                ByVal sOrigen As String, _
                                ByVal condicion As String) As Object

    Overloads Function Search(ByVal connectionString As String, _
                                ByVal sCmdText As String) As Object

    Overloads Function ExecSPDS(ByVal connectionString As String, _
                                ByVal nombreStoredProcedure As String, _
                                Optional ByVal arrayParamValues As ArrayList = Nothing) As DataSet

    Overloads Function ExecSPDS(ByVal cn As SqlConnection, _
                                ByVal nombreStoredProcedure As String, _
                                Optional ByVal arrayParamValues As ArrayList = Nothing) As DataSet

    Overloads Function ExecSPDR(ByVal connectionString As String, _
                                ByVal nombreStoredProcedure As String, _
                                Optional ByVal arrayParamValues As ArrayList = Nothing) As SqlDataReader

    Overloads Function ExecSPDR(ByVal cn As SqlConnection, _
                                ByVal nombreStoredProcedure As String, _
                                Optional ByVal arrayParamValues As ArrayList = Nothing) As SqlDataReader

    Overloads Function DSToServer(ByVal paramDataSet As DataSet, ByVal nombreStoredProcedure As String) As Boolean

    'Overloads Function GetStructure(ByVal connectionString As String, ByVal tabla As String, Optional ByVal nTipoInfo As Info = Info.Estructura) As DataSet

    'Overloads Function GetStructure(ByVal cn As SqlConnection, ByVal tabla As String, Optional ByVal nTipoInfo As Info = Info.Estructura) As DataSet

    Overloads Function GetSchema(ByVal connectionString As String, _
                                        ByVal tabla As String) As DataTable

    Overloads Function GetSchema(ByVal cn As SqlConnection, _
                                            ByVal tabla As String) As DataTable

    Overloads Function GetDate() As Date

    Overloads Function GetDate(ByVal formato As Formato) As Date

    Overloads Function LogError(ByVal nombreProceso As String, _
        ByVal nombreTerminal As String, ByVal nombreOperador As String, _
        ByVal descripcionError As String) As Boolean

    Overloads Function LogError(ByVal nombreProceso As String, _
        ByVal nombreTerminal As String, ByVal nombreOperador As String, _
        ByVal descripcionError As String, ByVal observaciones As String) As Boolean

End Interface
